home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / PInterfaces / Disks.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  3.3 KB  |  133 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Disks.p
  3.  
  4.      Contains:    Disk Driver Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1985-1991,1993, 1995-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT Disks;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __DISKS__}
  27. {$SETC __DISKS__ := 1}
  28.  
  29. {$I+}
  30. {$SETC DisksIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __OSUTILS__}
  37. {$I OSUtils.p}
  38. {$ENDC}
  39.  
  40.  
  41. {$PUSH}
  42. {$ALIGN MAC68K}
  43. {$LibExport+}
  44.  
  45.  
  46. CONST
  47.     sony                        = 0;
  48.     hard20                        = 1;
  49.  
  50. { Disk Driver Status csCodes }
  51.     kReturnFormatList            = 6;                            {  .Sony  }
  52.     kDriveStatus                = 8;
  53.     kMFMStatus                    = 10;
  54.  
  55. { Disk Driver Control csCodes }
  56.     kVerify                        = 5;
  57.     kFormat                        = 6;
  58.     kEject                        = 7;
  59.     kSetTagBuffer                = 8;                            {  .Sony  }
  60.     kTrackCache                    = 9;                            {  .Sony  }
  61.     kDriveIcon                    = 21;
  62.     kMediaIcon                    = 22;
  63.     kDriveInfo                    = 23;
  64.     kRawTrack                    = 18244;                        {  .Sony: “diagnostic” raw track dump  }
  65.  
  66. {
  67.     Note:
  68.  
  69.     qLink is usually the first field in queues, but back in the MacPlus
  70.     days, the DrvSts record needed to be expanded.  In order to do this without
  71.     breaking disk drivers that already added stuff to the end, the fields
  72.     where added to the beginning.  This was originally done in assembly language
  73.     and the record was defined to start at a negative offset, so that the qLink
  74.     field would end up at offset zero.  When the C and pascal interfaces where
  75.     made, they could not support negative record offsets, so qLink was no longer
  76.     the first field.  Universal Interfaces are auto generated and don't support
  77.     negative offsets for any language, so DrvSts in Disks.a has qLinks at a
  78.     none zero offset.  Assembly code which switches to Universal Interfaces will
  79.     need to compensate for that.
  80.  
  81. }
  82.  
  83.  
  84. TYPE
  85.     DrvStsPtr = ^DrvSts;
  86.     DrvSts = RECORD
  87.         track:                    INTEGER;                                {  current track  }
  88.         writeProt:                SignedByte;                                {  bit 7 = 1 if volume is locked  }
  89.         diskInPlace:            SignedByte;                                {  disk in drive  }
  90.         installed:                SignedByte;                                {  drive installed  }
  91.         sides:                    SignedByte;                                {  -1 for 2-sided, 0 for 1-sided  }
  92.         qLink:                    QElemPtr;                                {  next queue entry  }
  93.         qType:                    INTEGER;                                {  1 for HD20  }
  94.         dQDrive:                INTEGER;                                {  drive number  }
  95.         dQRefNum:                INTEGER;                                {  driver reference number  }
  96.         dQFSID:                    INTEGER;                                {  file system ID  }
  97.         CASE INTEGER OF
  98.         0: (
  99.             twoSideFmt:            SignedByte;                                {  after 1st rd/wrt: 0=1 side, -1=2 side  }
  100.             needsFlush:            SignedByte;                                {  -1 for MacPlus drive  }
  101.             diskErrs:            INTEGER;                                {  soft error count  }
  102.            );
  103.         1: (
  104.             driveSize:            INTEGER;
  105.             driveS1:            INTEGER;
  106.             driveType:            INTEGER;
  107.             driveManf:            INTEGER;
  108.             driveChar:            INTEGER;
  109.             driveMisc:            SignedByte;
  110.            );
  111.     END;
  112.  
  113.     DrvSts2                                = DrvSts;
  114.     DrvSts2Ptr                             = ^DrvSts2;
  115.  
  116. CONST
  117.     kdqManualEjectBit            = 5;
  118.  
  119. FUNCTION DiskEject(drvNum: INTEGER): OSErr;
  120. FUNCTION SetTagBuffer(buffPtr: UNIV Ptr): OSErr;
  121. FUNCTION DriveStatus(drvNum: INTEGER; VAR status: DrvSts): OSErr;
  122.  
  123. {$ALIGN RESET}
  124. {$POP}
  125.  
  126. {$SETC UsingIncludes := DisksIncludes}
  127.  
  128. {$ENDC} {__DISKS__}
  129.  
  130. {$IFC NOT UsingIncludes}
  131.  END.
  132. {$ENDC}
  133.